<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class unsynchronized_pool_resource</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.unsynchronized__pool__resource_8hpp" title="Header &lt;boost/container/pmr/unsynchronized_pool_resource.hpp&gt;">
<link rel="prev" href="classboost_1_1container_1_1pmr_1_1synchronized__pool__resource.html" title="Class synchronized_pool_resource">
<link rel="next" href="classboost_1_1container_1_1scoped__allocator__adaptor.html" title="Class template scoped_allocator_adaptor">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1container_1_1pmr_1_1synchronized__pool__resource.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.unsynchronized__pool__resource_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="classboost_1_1container_1_1scoped__allocator__adaptor.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class unsynchronized_pool_resource</span></h2>
<p>boost::container::pmr::unsynchronized_pool_resource</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.unsynchronized__pool__resource_8hpp" title="Header &lt;boost/container/pmr/unsynchronized_pool_resource.hpp&gt;">boost/container/pmr/unsynchronized_pool_resource.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> <span class="special">:</span>
  <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">pmr</span><span class="special">::</span><span class="identifier">memory_resource</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#id88-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a0a9be36bb903f273947ef18379d532a1"><span class="identifier">unsynchronized_pool_resource</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="structboost_1_1container_1_1pmr_1_1pool__options.html" title="Struct pool_options">pool_options</a> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">*</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab777b28a59d2678a609e5a996212209a"><span class="identifier">unsynchronized_pool_resource</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a3b6e073a43435aa6abeff33b08122458"><span class="identifier">unsynchronized_pool_resource</span></a><span class="special">(</span><a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">*</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a177c2d89aa5378f74b2497e9a3ef9b0d"><span class="identifier">unsynchronized_pool_resource</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="structboost_1_1container_1_1pmr_1_1pool__options.html" title="Struct pool_options">pool_options</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ad7252c8ec651f88b5201b7afacb4e58b"><span class="identifier">unsynchronized_pool_resource</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> 
  <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a2bb3c8a101e0f1936aa98bab13844e06"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a1e4d06448e898758958f82ca2c5da172"><span class="special">~</span><span class="identifier">unsynchronized_pool_resource</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a9443047b444bc5f33b3edbf9c4353225"><span class="identifier">release</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">*</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809"><span class="identifier">upstream_resource</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <a class="link" href="structboost_1_1container_1_1pmr_1_1pool__options.html" title="Struct pool_options">pool_options</a> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a1abce06f45fd89cea9c0661482a32ca6"><span class="identifier">options</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab93ea5015736d090d22ca805393c6ad0"><span class="identifier">pool_count</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a4cfe2a9b4752ddf05817099f0e852892"><span class="identifier">pool_index</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a88ddbe382a1f0a798bf3b46aeea63a43"><span class="identifier">pool_next_blocks_per_chunk</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a905bfe3fc2d52b630725dad4f90e6d78"><span class="identifier">pool_block</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1aa8f24c349da1b35b7aef191acb66ce35"><span class="identifier">pool_cached_blocks</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#id89-bb">protected member functions</a></span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="special">*</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a636c60bf4d150fb761804b16d3ee2521"><span class="identifier">do_allocate</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a8ffaf015d1a0c627782056fc6847320a"><span class="identifier">do_deallocate</span></a><span class="special">(</span><span class="keyword">void</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">virtual</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a705e436eb037bd8186caadce48682bd6"><span class="identifier">do_is_equal</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.8.14.29.3.4"></a><h2>Description</h2>
<p>A <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> is a general-purpose memory resources having the following qualities:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Each resource owns the allocated memory, and frees it on destruction, even if deallocate has not been called for some of the allocated blocks.</p></li>
<li class="listitem"><p>A pool resource consists of a collection of pools, serving requests for different block sizes. Each individual pool manages a collection of chunks that are in turn divided into blocks of uniform size, returned via calls to do_allocate. Each call to do_allocate(size, alignment) is dispatched to the pool serving the smallest blocks accommodating at least size bytes.</p></li>
<li class="listitem"><p>When a particular pool is exhausted, allocating a block from that pool results in the allocation of an additional chunk of memory from the upstream allocator (supplied at construction), thus replenishing the pool. With each successive replenishment, the chunk size obtained increases geometrically. [ Note: By allocating memory in chunks, the pooling strategy increases the chance that consecutive allocations will be close together in memory. - end note ]</p></li>
<li class="listitem"><p>Allocation requests that exceed the largest block size of any pool are fulfilled directly from the upstream allocator.</p></li>
<li class="listitem"><p>A <a class="link" href="structboost_1_1container_1_1pmr_1_1pool__options.html" title="Struct pool_options">pool_options</a> struct may be passed to the pool resource constructors to tune the largest block size and the maximum chunk size.</p></li>
</ul></div>
<p>
</p>
<p>An <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> class may not be accessed from multiple threads simultaneously and thus avoids the cost of synchronization entirely in single-threaded applications. </p>
<div class="refsect2">
<a name="id-1.3.8.14.29.3.4.5"></a><h3>
<a name="id88-bb"></a><code class="computeroutput">unsynchronized_pool_resource</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a0a9be36bb903f273947ef18379d532a1"></a><span class="identifier">unsynchronized_pool_resource</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="structboost_1_1container_1_1pmr_1_1pool__options.html" title="Struct pool_options">pool_options</a> <span class="special">&amp;</span> opts<span class="special">,</span> 
                             <a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">*</span> upstream<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">upstream</code> is the address of a valid memory resource.</p>
<p><span class="bold"><strong>Effects</strong></span>: Constructs a pool resource object that will obtain memory from upstream whenever the pool resource is unable to satisfy a memory request from its own internal data structures. The resulting object will hold a copy of upstream, but will not own the resource to which upstream points. [ Note: The intention is that calls to upstream-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1a1de478d2989e3864278786faa3266696">allocate()</a> will be substantially fewer than calls to this-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1a1de478d2989e3864278786faa3266696">allocate()</a> in most cases. - end note The behavior of the pooling mechanism is tuned according to the value of the opts argument.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing unless upstream-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1a1de478d2989e3864278786faa3266696">allocate()</a> throws. It is unspecified if or under what conditions this constructor calls upstream-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1a1de478d2989e3864278786faa3266696">allocate()</a>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab777b28a59d2678a609e5a996212209a"></a><span class="identifier">unsynchronized_pool_resource</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Same as <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a>(pool_options(), get_default_resource())</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a3b6e073a43435aa6abeff33b08122458"></a><span class="identifier">unsynchronized_pool_resource</span><span class="special">(</span><a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">*</span> upstream<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Same as <code class="computeroutput">unsynchronized_pool_resource(pool_options(), upstream)</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a177c2d89aa5378f74b2497e9a3ef9b0d"></a><span class="identifier">unsynchronized_pool_resource</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="structboost_1_1container_1_1pmr_1_1pool__options.html" title="Struct pool_options">pool_options</a> <span class="special">&amp;</span> opts<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Same as <code class="computeroutput">unsynchronized_pool_resource(opts, get_default_resource())</code>. </p>
</li>
<li class="listitem"><pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ad7252c8ec651f88b5201b7afacb4e58b"></a><span class="identifier">unsynchronized_pool_resource</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> 
<a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a2bb3c8a101e0f1936aa98bab13844e06"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html" title="Class unsynchronized_pool_resource">unsynchronized_pool_resource</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a1e4d06448e898758958f82ca2c5da172"></a><span class="special">~</span><span class="identifier">unsynchronized_pool_resource</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Calls <code class="computeroutput">this-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a9443047b444bc5f33b3edbf9c4353225">release()</a></code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a9443047b444bc5f33b3edbf9c4353225"></a><span class="identifier">release</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Calls Calls <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809">upstream_resource()</a>-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1aa74f44777d3da7f278ae7a013607c524">deallocate()</a></code> as necessary to release all allocated memory. [ Note: memory is released back to <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809">upstream_resource()</a></code> even if deallocate has not been called for some of the allocated blocks. - end note ] </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">*</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809"></a><span class="identifier">upstream_resource</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: The value of the upstream argument provided to the constructor of this object. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="structboost_1_1container_1_1pmr_1_1pool__options.html" title="Struct pool_options">pool_options</a> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a1abce06f45fd89cea9c0661482a32ca6"></a><span class="identifier">options</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: The options that control the pooling behavior of this resource. The values in the returned struct may differ from those supplied to the pool resource constructor in that values of zero will be replaced with implementation-defined defaults and sizes may be rounded to unspecified granularity. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab93ea5015736d090d22ca805393c6ad0"></a><span class="identifier">pool_count</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: The number of pools that will be used in the pool resource.</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extension. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a4cfe2a9b4752ddf05817099f0e852892"></a><span class="identifier">pool_index</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> bytes<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: The index of the pool that will be used to serve the allocation of <code class="computeroutput">bytes</code>. Returns <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab93ea5015736d090d22ca805393c6ad0">pool_count()</a></code> if <code class="computeroutput">bytes</code> is bigger than <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a1abce06f45fd89cea9c0661482a32ca6">options()</a>.largest_required_pool_block</code> (no pool will be used to serve this).</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extension. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a88ddbe382a1f0a798bf3b46aeea63a43"></a><span class="identifier">pool_next_blocks_per_chunk</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> pool_idx<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">pool_idx &lt; <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a4cfe2a9b4752ddf05817099f0e852892">pool_index()</a></code></p>
<p><span class="bold"><strong>Returns</strong></span>: The number blocks that will be allocated in the next chunk from the pool specified by <code class="computeroutput">pool_idx</code>.</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extension. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a905bfe3fc2d52b630725dad4f90e6d78"></a><span class="identifier">pool_block</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> pool_idx<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">pool_idx &lt; <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a4cfe2a9b4752ddf05817099f0e852892">pool_index()</a></code></p>
<p><span class="bold"><strong>Returns</strong></span>: The number of bytes of the block that the specified <code class="computeroutput">pool_idx</code> pool manages.</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extension. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1aa8f24c349da1b35b7aef191acb66ce35"></a><span class="identifier">pool_cached_blocks</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> pool_idx<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">pool_idx &lt; <a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a4cfe2a9b4752ddf05817099f0e852892">pool_index()</a></code></p>
<p><span class="bold"><strong>Returns</strong></span>: The number of blocks that the specified <code class="computeroutput">pool_idx</code> pool has cached and will be served without calling the upstream_allocator.</p>
<p><span class="bold"><strong>Note</strong></span>: Non-standard extension. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.29.3.4.6"></a><h3>
<a name="id89-bb"></a><code class="computeroutput">unsynchronized_pool_resource</code> protected member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="special">*</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a636c60bf4d150fb761804b16d3ee2521"></a><span class="identifier">do_allocate</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> bytes<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> alignment<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: A pointer to allocated storage with a size of at least <code class="computeroutput">bytes</code>. The size and alignment of the allocated memory shall meet the requirements for a class derived from <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a></code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: If the pool selected for a block of size bytes is unable to satisfy the memory request from its own internal data structures, it will call <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809">upstream_resource()</a>-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1a1de478d2989e3864278786faa3266696">allocate()</a></code> to obtain more memory. If <code class="computeroutput">bytes</code> is larger than that which the largest pool can handle, then memory will be allocated using <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809">upstream_resource()</a>-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1a1de478d2989e3864278786faa3266696">allocate()</a></code>.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing unless <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809">upstream_resource()</a>-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1a1de478d2989e3864278786faa3266696">allocate()</a></code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a8ffaf015d1a0c627782056fc6847320a"></a><span class="identifier">do_deallocate</span><span class="special">(</span><span class="keyword">void</span> <span class="special">*</span> p<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> bytes<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> alignment<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Return the memory at p to the pool. It is unspecified if or under what circumstances this operation will result in a call to <code class="computeroutput"><a class="link" href="classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1ab4a97b9ad331bf88125358e3b9ff5809">upstream_resource()</a>-&gt;<a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1memory__resource_1aa74f44777d3da7f278ae7a013607c524">deallocate()</a></code>.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">bool</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1pmr_1_1unsynchronized__pool__resource_1a705e436eb037bd8186caadce48682bd6"></a><span class="identifier">do_is_equal</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1pmr_1_1memory__resource.html" title="Class memory_resource">memory_resource</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: <code class="computeroutput">this == dynamic_cast&lt;const unsynchronized_pool_resource*&gt;(&amp;other)</code>. </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2009-2018 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1container_1_1pmr_1_1synchronized__pool__resource.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.unsynchronized__pool__resource_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="classboost_1_1container_1_1scoped__allocator__adaptor.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
